package main

import (
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
	"gorm.io/gorm/schema"
	"project05/src/model"
)

func main() {
	dns := "root:123456@(127.0.0.1:3306)/grpcproject?charset=utf8&parseTime=True&loc=Local"
	db, err := gorm.Open(mysql.Open(dns), &gorm.Config{
		NamingStrategy: schema.NamingStrategy{
			SingularTable: true,
		},
	})
	if err != nil {
		panic(err)
	}
	erro_Userdb := db.AutoMigrate(&model.User{})
	if err != nil {
		return
	} else {
		panic(erro_Userdb)
	}
}
